<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"	              
      xmlns:t="http://myfaces.apache.org/tomahawk">
      
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<title>All Tickets</title>
	
	<link rel="stylesheet" type="text/css" href="style/viewTicketsUser.css" />
</head>
<body>
	<f:view>
    	<t:inputHidden value="#{user.isSignedAsAdmin}" /> 
    	<h:form>
	    	<p align="right"><t:commandLink value="Sign Out" action="#{user.signOut}"></t:commandLink></p>
	        <p align="right"><t:commandLink value="Back" action="backViewTicketsAdmin"></t:commandLink></p>
	        <h1><t:outputText value ="#{messages.ticketInfoAdminMessage}"/></h1>
	        <hr />
	        	<center>
	      			    			
	      			<t:dataTable id="dt1" value="#{ticketsAdmin.ticketsAll}" 
					var="item" bgcolor="#F1F1F1" border="10" cellpadding="5" 
					cellspacing="3" first="0" rows="#{ticketsAdmin.nrRows}" width="50%"
					binding="#{ticketsAdmin.datatableTickets}">
	
					<f:facet name="header">
						<h:outputText value="#{messages.headerAdminMessage}" />
					</f:facet>
						
					<t:column style="font-weight:bold" headerstyle="background-color:#99CCFF;">
						<f:facet name="header">
							<t:outputText value="Nr." />
						</f:facet>
						<t:commandLink action="#{ticketsAdmin.selectTicket}" style="text-decoration: none; color:#B80000; font-size:20pt; font-weight:bold;">
						<t:outputText value="#{item.ticketId}"></t:outputText>
						</t:commandLink>
					</t:column>
						
					<t:column headerstyle="background-color:#99CCFF;">
						<f:facet name="header">
							<t:outputText value="Creation Date"/>
						</f:facet> 
						<t:outputText value="#{item.creationDate}"></t:outputText>
					</t:column>
						
					<t:column headerstyle="background-color:#99CCFF;">
						<f:facet name="header">
							<t:outputText value="User"/>
						</f:facet> 
						<t:outputText value="#{item.userName}"></t:outputText>
					</t:column>
					
					<t:column headerstyle="background-color:#99CCFF;">
						<f:facet name="header">
							<t:outputText value="Status"/>
						</f:facet> 
						<t:outputText value="#{item.statusString}"></t:outputText>
					</t:column>
						
					<f:facet name="footer">
						<h:outputText value="#{messages.footerAdminMessage}" />
					</f:facet> 
				</t:dataTable>
	    	</center>
    	</h:form>
	</f:view>
</body>
</html>